/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.ove.openmath.jome.ctrlview.bidim;

/**
 *
 * @author Mr.Sam
 */
import java.awt.*;
import fr.ove.openmath.jome.ctrlview.bidim.*;

/**
* A layout manager that lays components to be displayed between parenthesize.
*
* @author © 1999 DIRAT Laurent
* @version 2.0  13/12/1999
*/
public class BracketLayout extends EnclosingLayout {
    /**
    * Returns the opening
    */
    public SymbolDisplay createOpening() {
        SymbolDisplay bracket = new SymbolDisplay(displayToLay.getGraphicContext(), 
                                                new BracketSymbol(true,
                                                                displayToLay.getFontMetrics(displayToLay.getFont()).getHeight() / 4, 
                                                                displayToLay));            
        // Le display de la parenthèse est le display d'un opérateur (on peut le considérer comme tel)
        bracket.setIsSymbolOperatorDisplay(true);
        return bracket;
    }
    
    /**
    * Returns the closing
    */
    public SymbolDisplay createClosing() {
        SymbolDisplay bracket = new SymbolDisplay(displayToLay.getGraphicContext(), 
                                                new BracketSymbol(false,
                                                                displayToLay.getFontMetrics(displayToLay.getFont()).getHeight() / 4, 
                                                                displayToLay));            
        // Le display de la parenthèse est le display d'un opérateur (on peut le considérer comme tel)
        bracket.setIsSymbolOperatorDisplay(true);
        return bracket;
    }
}
